<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		{template admin/top.html}
		<link href="{ADMIN_THEME}images/reset.css" rel="stylesheet" type="text/css" />
		<link href="{ADMIN_THEME}images/system.css" rel="stylesheet" type="text/css" />
		<link href="{ADMIN_THEME}images/dialog.css" rel="stylesheet" type="text/css" />
		<link href="{ADMIN_THEME}images/main.css" rel="stylesheet" type="text/css" />
		<link href="{ADMIN_THEME}images/switchbox.css" rel="stylesheet" type="text/css" />
		<link href="{ADMIN_THEME}luos/css/style.min.css?v=4.1.0" rel="stylesheet">
		<link href="{ADMIN_THEME}images/table_form.css" rel="stylesheet" type="text/css" />
		<link href="{SITE_THEME}admin/images/ruku.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="{ADMIN_THEME}js/jquery.min.js"></script>
		<script type="text/javascript" src="{ADMIN_THEME}js/dialog.js"></script>
		<script type="text/javascript" src="{LANG_PATH}lang.js"></script>
		<script type="text/javascript" src="{ADMIN_THEME}js/my97/WdatePicker.js"></script>
		<title>admin</title>
	</head>

	<body style="font-weight: normal;">
		<div class="subnav">
			<div class="content-menu ib-a blue line-x">
				<a href="{url('admin/tixian/')}" {if !$status}class="on"{/if}><em>{lang('全部列表')}</em></a><span>|</span>
				<a href="{url('admin/tixian/',array('status' => 2))}" {if $status == 2}class="on"{/if}><em>{lang('已处理')}</em></a><span>|</span>
				<a href="{url('admin/tixian/',array('status' => 1))}" {if $status == 1}class="on"{/if}><em>{lang('未处理')}</em></a><span>|</span>
				
			</div>
			<div class="bk10"></div>
			<div class="table-responsive mytable">
				<form action="" method="post" name="myform" id="myform">
					<table width="100%" class="table table-striped">
						<thead>
							<tr>
								<th width="5%" align="right"><input name="deletec" id="deletec" type="checkbox" onClick="setC()" /></th>
								<th width="3%" align="left">会员ID</th>
								<th width="6%" align="left">会员名称</th>
								<th width="6%" align="left">手机号/账号</th>
								<th width="19%" align="left">商品名称</th>
								<th width="19%" align="left">评论内容</th>
								<th width="10%" align="left">评论时间</th>
								<th width="19%" align="left">管理员回复</th>
								<th width="25%" align="left">操作</th>
							</tr>
						</thead>
						<tbody>
							{loop $list $t}
							<tr>
								<td align="left"><input name="del_{$t[id]}" type="checkbox" class="deletec" /></td>
								<td align="left">{$t[member_id]}</td>
								<td align="left">{$t[name]}</td>
								<td align="left">{$t[username]}</td>
								<td align="left">{$t[title]}</td>
								<td align="left">{$t[content]}</td>
								<td align="left" style="color:#488fcd;">{date('Y-m-d H:i:s',$t[addtime])}</td>
								<td style="color:red;" align="left">{$t[huifu]}</td>
								<td align="left">
									<a href="javascript:" onclick="a({$t['id']})">回复<i class="layui-icon"></i>
									<a href="javascript:;" onClick="if(confirm('确认删除？')){ window.location.href='<?php echo url('admin/pinglun/del/',array('id'=>$t['id']));?>'; }">删除<i class="layui-icon">&#xe640;</i>
								</td>
								
							</tr>
							{/loop}
							<script type="text/javascript">
								function a(o){
                                layer.open({
									title:'回复评论',
                                    type: 1,
                                    content:"<textarea id='textarea' cols='50' rows='10'></textarea>",//tent是一个DOM
                                    btn: ['回复','取消'] //可以无限个按钮
                                    ,yes: function(index, layero){
                                        //按钮【按钮一】的回调
                                        $.ajax({
                                            type:"POST",
                                            url:"index.php?s=admin&c=pinglun&a=ajax_huifu",
                                            data:"id="+o+"&text="+$('#textarea').val(),
                                            dateType:"json",
                                            success:function(data){
                                               if(data==1){
                                                   layer.msg('回复成功!', {icon: 6,end:function(){location.reload()}});
											   }
                                            }
                                        })

                                    },btn2: function(index, layero){
                                        //按钮【按钮二】的回调
                                    }
                                });
                                }
							</script>
							<tr>
						<td colspan="9" align="left">&nbsp;
							<input type="submit" class="btn btn-success btn-sm" value="删除" name="submit" onClick="return confirm_del()" />&nbsp;</td>
						</tr> 
							<tr>
								<td colspan="99" align="left">
								</td>
							</tr>
						
						</tbody>
					</table>
				{str_replace('<a>共' . $total . '条</a>', '<a>耗时' . runtime() . '秒</a><a>共' . $total . '条</a>', $pagelist)}
				</form>
			</div>
		</div>
		<script type="text/javascript">

			function confirm_del() {
				if(confirm('{lang('确定要删除吗？')}')) {
					return true;
				} else {
					return false;
				}
			}

			function setC() {
				if($("#deletec").attr('checked')) {
					$(".deletec").attr("checked", true);
				} else {
					$(".deletec").attr("checked", false);
				}
			}
		</script>
	</body>

</html>